﻿<%@ control language="C#" autoeventwireup="true" inherits="UserControls_QLNguoiDung, App_Web_3yxxjaol" %>


<style type="text/css">
    .auto-style1
    {
        width: 156px;
    }
</style>


<form id="form2" runat="server">

    Thêm người dùng:<br />
    <table style="width:100%;">
        <tr>
            <td class="auto-style1">Mã ND:</td>
            <td>
                <asp:TextBox ID="txtMaND" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtMaND" ErrorMessage="* Bắt buộc"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Tên: </td>
            <td>
                <asp:TextBox ID="txtTenND" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtTenND" ErrorMessage="* Bắt buộc"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Mã Khoa:</td>
            <td>
                <asp:TextBox ID="txtMaKH" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Số lượng tin nhắn:</td>
            <td>
                <asp:TextBox ID="txtSLTNCon" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Quyền hạn: </td>
            <td>
                <asp:TextBox ID="txtQuyenHan" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Mật khẩu: </td>
            <td>
                <asp:TextBox ID="TextBox6" runat="server" TextMode="Password"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">Nhập lại mật khẩu:</td>
            <td>
                <asp:TextBox ID="TextBox7" runat="server" TextMode="Password"></asp:TextBox>
                <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="TextBox6" ControlToValidate="TextBox7" ErrorMessage="Mật khẩu nhập chưa chính xác"></asp:CompareValidator>
            </td>
        </tr>
    </table>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Thêm" />
    <asp:Label ID="Label1" runat="server"></asp:Label>
    <br />
&nbsp;<br />
    <br />
&nbsp;<br />
&nbsp;<br />
    <br />
    <br />
&nbsp;</form>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:SMSWebConnectionString %>" DeleteCommand="DELETE FROM [NguoiDung] WHERE [MaND] = @original_MaND AND [TenND] = @original_TenND AND (([MaKH] = @original_MaKH) OR ([MaKH] IS NULL AND @original_MaKH IS NULL)) AND (([SLTNCon] = @original_SLTNCon) OR ([SLTNCon] IS NULL AND @original_SLTNCon IS NULL)) AND (([QuyenHan] = @original_QuyenHan) OR ([QuyenHan] IS NULL AND @original_QuyenHan IS NULL)) AND (([MatKhau] = @original_MatKhau) OR ([MatKhau] IS NULL AND @original_MatKhau IS NULL))" InsertCommand="INSERT INTO [NguoiDung] ([MaND], [TenND], [MaKH], [SLTNCon], [QuyenHan], [MatKhau]) VALUES (@MaND, @TenND, @MaKH, @SLTNCon, @QuyenHan, @MatKhau)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [NguoiDung]" UpdateCommand="UPDATE [NguoiDung] SET [TenND] = @TenND, [MaKH] = @MaKH, [SLTNCon] = @SLTNCon, [QuyenHan] = @QuyenHan, [MatKhau] = @MatKhau WHERE [MaND] = @original_MaND AND [TenND] = @original_TenND AND (([MaKH] = @original_MaKH) OR ([MaKH] IS NULL AND @original_MaKH IS NULL)) AND (([SLTNCon] = @original_SLTNCon) OR ([SLTNCon] IS NULL AND @original_SLTNCon IS NULL)) AND (([QuyenHan] = @original_QuyenHan) OR ([QuyenHan] IS NULL AND @original_QuyenHan IS NULL)) AND (([MatKhau] = @original_MatKhau) OR ([MatKhau] IS NULL AND @original_MatKhau IS NULL))">
    <DeleteParameters>
        <asp:Parameter Name="original_MaND" Type="String" />
        <asp:Parameter Name="original_TenND" Type="String" />
        <asp:Parameter Name="original_MaKH" Type="String" />
        <asp:Parameter Name="original_SLTNCon" Type="Double" />
        <asp:Parameter Name="original_QuyenHan" Type="String" />
        <asp:Parameter Name="original_MatKhau" Type="String" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="MaND" Type="String" />
        <asp:Parameter Name="TenND" Type="String" />
        <asp:Parameter Name="MaKH" Type="String" />
        <asp:Parameter Name="SLTNCon" Type="Double" />
        <asp:Parameter Name="QuyenHan" Type="String" />
        <asp:Parameter Name="MatKhau" Type="String" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="TenND" Type="String" />
        <asp:Parameter Name="MaKH" Type="String" />
        <asp:Parameter Name="SLTNCon" Type="Double" />
        <asp:Parameter Name="QuyenHan" Type="String" />
        <asp:Parameter Name="MatKhau" Type="String" />
        <asp:Parameter Name="original_MaND" Type="String" />
        <asp:Parameter Name="original_TenND" Type="String" />
        <asp:Parameter Name="original_MaKH" Type="String" />
        <asp:Parameter Name="original_SLTNCon" Type="Double" />
        <asp:Parameter Name="original_QuyenHan" Type="String" />
        <asp:Parameter Name="original_MatKhau" Type="String" />
    </UpdateParameters>
</asp:SqlDataSource>

